<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="box">
        <select v-model="province" @change="city=0;district=0">
            <option v-for="(obj,index) in area" :value="index">{{ obj.name }}</option>
        </select>
        <select v-model="city" @change="district=0">
            <option v-for="(obj,index) in cityObj.city" :value="index">{{ obj.name }}</option>
        </select>
        <select v-model="district">
            <option v-for="(name,index) in districtObj.district" :value="index">{{ name }}</option>
        </select>
        <p>{{ address }}</p>
    </div>

    <script>


        var app = new Vue({
            el: '#box',
            data: {
                province: 0,
                city: 0,
                district: 0,
                area: [
                    {
                        name: "河南省", city: [
                            { name: "郑州市", district: ["二七区", "金水区", "经开区"] },
                            { name: "开封市", district: ["鼓楼区", "金明区"] },
                        ]
                    },
                    {
                        name: "河北省", city: [
                            { name: "石家庄市", district: ["长安区", "桥东区", "桥西区"] },
                            { name: "张家口市", district: ["下花园区", "宣化县"] },
                        ]
                    }
                ]
            },
            computed: {
                cityObj: function () {
                    return this.area[this.province];
                    console.log(this.area[this.province])
                },
                districtObj: function () {
                    return this.cityObj.city[this.city];
                },
                address: function () {
                    return this.cityObj.name
                        + this.districtObj.name
                        + this.districtObj.district[this.district];
                }
            }
        });
    </script>
</body>

</html>